package judesart.app.client.controller;

import java.util.List;

import judesart.app.domain.Exhibition;
import judesart.app.domain.ExhibitionVideo;
import judesart.app.shared.ArtworkShort;
import judesart.app.shared.SearchResult;
import judesart.app.shared.UploadToken;
import judesart.app.shared.ValidationException;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("exhibition")
public interface ExhibitionController extends RemoteService {
    public static class Util {
        private static ExhibitionControllerAsync instance;

        public static ExhibitionControllerAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(ExhibitionController.class);
            }
            return instance;
        }
    }

    Exhibition getExhibition(Long exhibitionId);

    SearchResult<Exhibition> searchExhibitions(int startAt, int maxElements);

    Exhibition createExhibition(Exhibition exhibition)
            throws ValidationException;

    Exhibition updateExhibition(Exhibition exhibition)
            throws ValidationException;

    void deleteExhibition(Long exhibitionId);

    String findPhotoKeyByImageId(Long imageId);

    UploadToken getVideoUploadFormToken(Long exhibitionId);

    ExhibitionVideo addYoutubeVideoById(Long exhibitionId, String videoId);

    List<ArtworkShort> findExhibitionArtworks(Long exhibitionId);

    void addArtworkToExhibition(Long exhibitionId, Long artworkId);

    void deleteArtworkFromExhibition(Long exhibitionId, Long artworkId);

    List<Exhibition> findAllUserExhibitions(Long userId);
}
